<template>
    <n-layout has-sider>
        <n-layout-sider width="64">
            <LeftMenu style="overflow: hidden;" />
        </n-layout-sider>
        <n-layout>
            <RouterView />
        </n-layout>
    </n-layout>
</template>
<script setup lang="ts">
import { userInfoApi } from "../api/user";
import LeftMenu from "../components/LeftMenu.vue";
import { io, Socket } from "socket.io-client";
import { userStore } from "../store/userStore";
import { useMessage } from "naive-ui";
window.message = useMessage()

const c = userStore()
userInfoApi().then((e) => c.setUser(e.data))

const socket: Socket = io("http://127.0.0.1:1145")
socket.on("connect", () => socket.emit("ck", c.tokenVal));
</script>